home *** CD-ROM | disk | FTP | other *** search
- Path: pcc002.ids-scheer.de!news
- From: schley@ids-scheer.de (Schley Roland)
- Newsgroups: comp.lang.c++
- Subject: MSVC Big Problem with Borland dll
- Date: Tue, 23 Jan 1996 17:05:00 GMT
- Organization: IDS Prof. Scheer GmbH
- Message-ID: <4e3451$3bi@pcc002.ids-scheer.de>
- NNTP-Posting-Host: pse107.ids-scheer.de
- X-Newsreader: Forte Agent .99.82
-
- I have created a DLL with Borland C++ 4.5 which does something
- like this:
-
- <<<
-
- #include<iostream.h>
-
- class A
- {
- public:
- void DoException();
- };
-
- void A :: DoException()
- {
- try {
- throw ( long( 55 ) ); }
-
- catch ( long x ) {
- cout << "catch " << x << "\n"; }
-
- }
-
- ///
- // the exported function
- ///
-
- extern "C" {
- void _export _cdecl Func1();
- }
-
-
- void _export _cdecl Func1()
- {
- A a;
- a.DoException();
- }
-
- <<<
-
- I have a little C++ test program that just calls the exported
- function Func1() which throws the exception:
-
- <<<
-
- extern "C" {
-
- void Func1(); }
-
-
- void main()
- {
- Func1();
- }
-
- <<<
-
- When I compile the test program with Borland C++ 4.5 the
- program works as expected.
- But when I compile it with MSVC 4.0 the program crashes:
- When the function Func1() is called in main() under the
- debugger, I receive an "unhandled exception in
- test.exe(KERNEL32.DLL): Access Violation."
-
- Please help me!!
-
- TIA Roland
-
-